﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace David_Albert
{
    public partial class FormAfegirCat : Form
    {
        public Categoria cat;

        public FormAfegirCat()
        {
            InitializeComponent();
        }

        private void btnAfgCatCan_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = null;
            cat = new Categoria(0, this.textBox1.Text);
            this.Close();
        }

        private void btnAfgCatAcce_Click(object sender, EventArgs e)
        {
            
            cat = new Categoria(0, this.textBox1.Text);
            try
            {
                this.Close();
            }
            catch (Exception n){
                MessageBox.Show("No pots inserir un tema en blanc", "Informacio", MessageBoxButtons.OK, MessageBoxIcon.Error);
                
            }
        }

    }
}
